Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add full ESM support via an import export condition #1115

Closed
wants to merge 24 commits into from

Conversation

amannn
Copy link
Owner

@amannn amannn commented Jun 11, 2024

We currently support ESM partially. This PR investigates switching to bunchee to enable full ESM while supporting:

  1. 'use client' directives split bundles
  2. Separate development/production build for ESM to avoid process.env.NODE_ENV checks
  3. CJS/ESM dual build

TODO

Release docs

  • Might have to update vitest to latest in case dev condition is not applied

Fixes #1153

Copy link

vercel bot commented Jun 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 10:15am
next-intl-example-app-router ❌ Failed (Inspect) Aug 22, 2024 10:15am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 10:15am

# Conflicts:
#	packages/next-intl/package.json
#	packages/next-intl/rollup.config.mjs
#	packages/use-intl/package.json
#	packages/use-intl/rollup.config.mjs
#	pnpm-lock.yaml
#	scripts/getBuildConfig.mjs
# Conflicts:
#	packages/next-intl/package.json
#	packages/use-intl/package.json
#	pnpm-lock.yaml
# Conflicts:
#	package.json
#	packages/next-intl/package.json
#	packages/use-intl/package.json
#	pnpm-lock.yaml
# Conflicts:
#	package.json
#	packages/next-intl/package.json
#	packages/next-intl/src/navigation/createLocalizedPathnamesNavigation.test.tsx
#	packages/next-intl/src/navigation/createSharedPathnamesNavigation.test.tsx
#	packages/next-intl/src/navigation/react-client/ClientLink.test.tsx
#	packages/next-intl/src/navigation/react-client/useBasePathname.test.tsx
#	packages/next-intl/src/navigation/shared/redirects.tsx
#	packages/next-intl/src/navigation/shared/utils.tsx
#	packages/next-intl/src/react-client/useFormatter.test.tsx
#	packages/next-intl/src/react-client/useLocale.test.tsx
#	packages/next-intl/src/react-client/useNow.test.tsx
#	packages/next-intl/src/react-client/useTimeZone.test.tsx
#	packages/next-intl/src/react-client/useTranslations.test.tsx
#	packages/next-intl/src/runtimes/react-server/getTranslations.tsx
#	packages/next-intl/src/runtimes/react-server/getTranslator.tsx
#	packages/next-intl/src/server/react-client/index.test.tsx
#	packages/next-intl/src/shared/NextIntlClientProvider.test.tsx
#	packages/next-intl/src/shared/utils.test.tsx
#	packages/next-intl/src/shared/utils.tsx
#	packages/next-intl/test/navigation/shared/utils.test.tsx
#	packages/use-intl/package.json
#	pnpm-lock.yaml
@amannn
Copy link
Owner Author

amannn commented Oct 29, 2024

Closed in favor of #1470

@amannn amannn closed this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing createMiddleware() doesn't work as the tutorial suggests in type:module packages
1 participant